﻿@using SlamDunk.CMS.Model
@using SlamDunk.CMS.Model.DataModel
@using SlamDunk.CMS.Model.ViewModel
@{
    List<ArticleViewForRead> articleList = Model.ArticleList;
    Channel currentChannel = articleList[0].Channel;
}
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>@currentChannel.ChannelName</title>
    @Include("Head", Model)
    <script type="text/javascript">
        $(function () {
            //设置页码下拉框选中
            var currentPageIndex = window.location.href.split('-')[1].split('.')[0];
            $('#sltPageNav').val(currentPageIndex);
        });

        //页面跳转方法
        function redirectPage() {
            var pageIndex = parseInt($('#sltPageNav').val());
            window.location.href = '@currentChannel.SaveDirectory/List-' + pageIndex + '.html';
        }
    </script>
</head>
<body>
    @Include("Top", Model)
    @Include("SubBanner", Model)
    <div class="Sub_Middlecon">
        <div class="Sub_Middle">
            @Include("Left", Model)
            <div class="SubMid_R">
                <div class="SubMid_R1">
                    <span class="SubMid_R1title">@currentChannel.ChannelName</span><span class="SubMid_R1tip"></span>
                    <span class="SubMid_R1path">网站首页：<a href="/">首页</a> - <span class="SubMid_R1current">@currentChannel.ChannelName</span></span>
                </div>
                <div class="SubMid_R2">
                    <div class="SubMid_ArticleListcon">
                        <ul>
                            @foreach (ArticleViewForRead article in articleList)
                            {
                                <li>
                                    <span class="r">@article.AddTime</span><a href="@article.Url" target="_blank">@article.Title</a>
                                </li>
                            }
                        </ul>
                    </div>
                </div>
                <div class="SubMid_R3">
                    <div class="SubMid_R3con">
                        <span>页码：@Model.CurrentPage/@Model.PageCount │ 共@{@Model.RowCount}条</span>
                        <a href="@currentChannel.SaveDirectory/List-@{@Model.FirstPage}.html">首页</a>
                        <a href="@currentChannel.SaveDirectory/List-@{@Model.PrevPage}.html">上一页</a>
                        <a href="@currentChannel.SaveDirectory/List-@{@Model.NextPage}.html">下一页</a>
                        <a href="@currentChannel.SaveDirectory/List-@{@Model.LastPage}.html">末页</a>
                        <select id="sltPageNav" onchange="redirectPage();">
                            @for (int i = 1; i <= @Model.PageCount; i++)
                            {
                                <option value="@i">第@{@i}页</option>
                            }
                        </select>
                    </div>
                </div>
            </div>
            <div class="clear"></div>
        </div>
    </div>
    @Include("Foot", Model)
</body>
</html>